Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build against glibc trunk: getopt #17

Merged
merged 2 commits into from
May 4, 2017

Conversation

tschwinge
Copy link
Member

In file included from /usr/include/bits/getopt_posix.h:27:0,
from /usr/include/unistd.h:872,
from ../nvptx-ld.c:23:
/usr/include/bits/getopt_core.h:91:12: error: declaration of 'int getopt(int, char* const*, const char*) throw ()' has a different exception specifier
extern int getopt (int ___argc, char const ___argv, const char __shortopts)
^~~~~~
In file included from ../nvptx-ld.c:22:0:
../include/getopt.h:113:12: note: from previous declaration 'int getopt(int, char
const
, const char
)'
extern int getopt (int argc, char *const *argv, const char *shortopts);
^~~~~~

jakubjelinek and others added 2 commits May 3, 2017 16:08
  In file included from /usr/include/bits/getopt_posix.h:27:0,
		   from /usr/include/unistd.h:872,
		   from ../nvptx-ld.c:23:
  /usr/include/bits/getopt_core.h:91:12: error: declaration of 'int getopt(int, char* const*, const char*) throw ()' has a different exception specifier
   extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
	      ^~~~~~
  In file included from ../nvptx-ld.c:22:0:
  ../include/getopt.h:113:12: note: from previous declaration 'int getopt(int, char* const*, const char*)'
   extern int getopt (int argc, char *const *argv, const char *shortopts);
	      ^~~~~~
@tschwinge
Copy link
Member Author

@jakubjelinek, should the AC_CHECK_DECLS(getopt) really be done in libiberty/configure.ac instead of the top-level configure.ac? But given the overall mess of the libiberty integration (see #1) I guess we don't really care at this point. ;-/

@tschwinge tschwinge merged commit 2654c67 into SourceryTools:master May 4, 2017
@tschwinge tschwinge deleted the jakub-glibc branch May 4, 2017 17:15
@jakubjelinek
Copy link
Contributor

It is done in libiberty/configure.ac too. The problem is that the toplevel includes the libiberty headers and thus needs the right HAVE_DECL_GETOPT definition when compiling the toplevel sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants